//
//  TableFooterView.m
//  Study1
//
//  Created by ChenJie on 2/10/20.
//  Copyright © 2020 OrgName. All rights reserved.
//

#import "TableFooterView.h"

@interface TableFooterView ()

@property (nonatomic, strong) UILabel *label;

@end

@implementation TableFooterView

#pragma mark - Lifecycle methods

//+ (void)load {
/// Do not keep an empty +load method
//}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor cyanColor];
        [self addSubview:self.label];
    }
    return self;
}

- (void)willMoveToSuperview:(UIView *)newSuperview {
    [super willMoveToSuperview:newSuperview];
}

- (void)didMoveToSuperview {
    [super didMoveToSuperview];
}

- (void)willMoveToWindow:(UIWindow *)newWindow {
    [super willMoveToWindow:newWindow];
}

- (void)didMoveToWindow {
    [super didMoveToWindow];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    //
    self.label.frame = self.bounds;
}

#pragma mark - Public methods



#pragma mark - Private methods



#pragma mark - Event response methods



#pragma mark - Delegate methods



#pragma mark - Setter



#pragma mark - Getter

- (UILabel *)label {
    if (!_label) {
        UILabel *label = [UILabel new];
        label.text = @"Table Footer";
        label.textAlignment = NSTextAlignmentCenter;
        label.font = [UIFont systemFontOfSize:20];
        
        _label = label;
    }
    return _label;
}

#pragma mark - Memory management methods

- (void)dealloc {
}

@end
